package com.tinyspot.concrete.ribbon.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

/**
 * @author Tinyspot
 * @date 2022-12-24 21:38
 */
@RestController
public class AdminController {

    @Resource
    private RestTemplate restTemplate;

    @RequestMapping("/invoke")
    public String invoke(String message) {
        // 去调用 Eureka 的服务提供者 concrete-eureka-client
        return restTemplate.getForObject("http://concrete-eureka-client/show?message=" + message, String.class);
    }
}
